{% load article_simple_tag %}

<link rel="stylesheet" href="/statics/plugins/editor.md-master/css/editormd.min.css" />

<form method="post" action="{% url 'article_management' %}add/0/" class="pageForm required-validate" onsubmit="return validateCallback(this, dialogAjaxDone);">
    {% csrf_token %}
    <div layoutH="97">

        <div style="height: 30px">
            <label for="column_id" style="float: left; height: 21px; line-height: 21px;margin-right: 3px; width: 70px; text-align: right">栏目: </label>
            <select class="combox" name="column_id" id="column_id">
                <option value="">请选择</option>
                {% for i in columns_list %}
                    <option value="{% get_id i %}">{{ i.name }}</option>
                {% endfor %}
            </select>
        </div>

        <div style="height: 30px;">
            <label for="title" style="float: left; height: 21px; line-height: 21px;margin-right: 3px; width: 70px; text-align: right">文章标题: </label>
            <input name="title" id="title" class="required" type="text" placeholder="请输入文章标题" style="float: left; width: 600px" />
        </div>

        <div style="height: 30px;">
            <label for="tag" style="float: left; height: 21px; line-height: 21px;margin-right: 3px; width: 70px; text-align: right">标签: </label>
            <input name="tag" id="tag" type="text" placeholder="请输入标签,多个用逗号隔开" style="float: left; width: 600px" />
        </div>

        <div style="height: 30px">
            <label for="show" style="float: left; height: 21px; line-height: 21px;margin-right: 3px; width: 70px; text-align: right">状态: </label>
            <select class="combox" name="show" id="show">
                <option value="1">发布</option>
                <option value="0">不发布</option>
            </select>
        </div>

        <div id="editormd">
            <textarea name="content" style="display:none;"></textarea>
        </div>

	</div>
    <div class="formBar">
        <ul>
            <li><div class="buttonActive"><div class="buttonContent"><button type="submit">发布</button></div></div></li>
        </ul>
    </div>


</form>


<br>
<script src="/statics/plugins/editor.md-master/editormd.min.js"></script>
<script type="text/javascript">
    $(function() {
        var editor = editormd("editormd", {
            path : "/statics/plugins/editor.md-master/lib/", // Autoload modules mode, codemirror, marked... dependents libs path
            width: "90%",
            height: "80%",
{#            saveHTMLToTextarea: true,#}

            // 开启图片本地上传
            imageUpload    : true,
            imageFormats   : ["jpg"],
            imageUploadURL : "{% url 'img_upLoad' %}"

        });

        /*
        // or
        var editor = editormd({
            id   : "editormd",
            path : "../lib/"
        });
        */
    });
</script>